package com.project.restaurant.thirdpart.mail;

import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@NoArgsConstructor
@Accessors(chain = true)
public class Mail {

    //要求只能指定qq邮箱
    @NotEmpty
    private String to;
    @NotEmpty
    private String subject;
    @NotEmpty
    private String content;
    //发送邮件的日期
    @NotNull
    private Date date = new Date();


    public Mail(String to, String subject, String content){
        this.to = to;
        this.subject = subject;
        this.content = content;
    }

}
